import { get, post } from '@/utils/request'
const BASE_URL = window.baseUrl.dispose

/** 分页查询事件处置列表  */
export function tableList(query) {
  return post(BASE_URL + '/incident/search/list', query)
}

/**   获取左侧筛选树   */
export function getTree(query) {
  return post(BASE_URL + '/incident/filter/disFilter', query)
}
/**  获取事件状态统计  */
export function getTotal(query) {
  return post(BASE_URL + '/incident/search/disposalStatus', query)
}

/** 误报接口 */
export function handleFalse(query) {
  return post(BASE_URL + '/incident/events/mark/false', query)
}

/** 根据字典分组擦查询字典数据信息  */
export function dictList(query) {
  return get(BASE_URL + '/dictItems/listByType', query)
}
/** 导出  */
export function exportData(query) {
  return post(BASE_URL + '/aggrIncident/export', query)
}

/** 根据事件code查询应急响应预案   */
export function preplan(query) {
  return get(BASE_URL + '/incident/event/preplan', query)
}
/** 根据事件code查询应急响应预案_content   */
export function eventContent(query) {
  return get(BASE_URL + '/incident/event/content', query)
}
//  分页查询聚合事件列表
export function aggrIncidentList(query) {
  return post(BASE_URL + '/aggrIncident/search/list', query)
}

/** 聚合查询一个月趋势 */
export function aggrIncidentChart(query) {
  return get(BASE_URL + '/aggrIncident/search/charts', query)
}

/**   获取事件处置详情：by  ids   */
export function getDetails(query) {
  return get(BASE_URL + '/aggrIncident/search/detail/ids/' + query)
}

/**   获取事件处置详情：by  batchId  */
export function getDetailsByBatchId(query) {
  return get(BASE_URL + '/aggrIncident/search/detail/batchId/' + query)
}

/**  处置：发起工单  */
export function disposal(query) {
  return post(BASE_URL + '/aggrIncident/events/disposal', query)
}

/**  处置  */
export function execute(query) {
  return post(BASE_URL + '/aggrIncident/events/execute', query)
}
/**  获取流程表单 */
export function getProcessForm(query) {
  return get(BASE_URL + '/aggrIncident/events/disposal/formVariables', query)
}
/**  获取协办流程表单 */
export function getApplyProcessForm(query) {
  return get(BASE_URL + '/aggrIncident/events/disposal/apply/formVariables', query)
}
// 根据batchid查询直接关闭处置详情
export function directly(batchId) {
  return get(BASE_URL + '/aggrIncident/search/directly/' + batchId)
}
// 通过指标code获得应急响应预警信息
export function queryContentByKpiCode(kpiCode) {
  return get(BASE_URL + '/emergencyPlan/queryContentByKpiCode', { kpiCode })
}
